const mongoose = require("mongoose");
const Schema = mongoose.Schema;

//用户表
const userSchema = new Schema({
  _id: String,
  userName: String,
  phone: String,
  email: String,
  avatar: String,
  birth: String,
  gender: String,
  password: String,
  createdItem: Number,
});

//收货地址表
const shippingAddressSchema = new Schema({
  _id: String,
  userId: String,
  shippingAddress: String,
  isDefault: Boolean,
});

const shippingCarSchema = new Schema({
  _id: String,
  gsColorCode: String,
  goodsCode: String,
  goodsName: String,
  gscPicmainId: String,
  gscPicmainPath: String,
  colorName: String,
  goodsSku: String,
  sizeName: String,
  crmId: String,
  addPrice: Number,
  quantity: Number,
  userId:String
});

exports.userSchema = mongoose.model("user", userSchema);

exports.shippingAddressSchema = mongoose.model(
  "shippingAddress",
  shippingAddressSchema
);

exports.shippingCarSchema = mongoose.model(
  "user_shippingCar",
  shippingCarSchema
);
